package d0323;

import java.io.*;

public class SerializableTest {
    private static ObjectOutput oos;

    public static void main(String[] args) throws IOException, ClassNotFoundException {
     //   ByteArrayOutputStream baos=new ByteArrayOutputStream();
       FileOutputStream fos=new FileOutputStream(new File("src/d0323/serData.txt"));
        ObjectOutputStream oos=new ObjectOutputStream(fos);
        Person person=new Person("jack","22","dalian");
        oos.writeObject(person);
        oos.close();
        fos.close();
        FileInputStream fis=new FileInputStream(new File("src/d0323/serData.txt"));
        ObjectInputStream ois=new ObjectInputStream(fis);
        Person person1=(Person)ois.readObject();
     //   System.out.println(person1.getName()+"\t"+person1.getAge()+"\t"+person1.getAddress());
        oos.close();
        fos.close();

    }
}
